dest=src/main/webapp/WEB-INF/portlet.xml
echo "<portlet-app xmlns=\"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd\" version=\"2.0\"\
 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\
 xsi:schemaLocation=\"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd\">" > $dest

ls -1 src/main/java/ru/urfc/portal/ui/client/googlets/*.java | sed 's/.*\///g' | sed 's/\.java//g' | awk -v portlet=BasePortlet -f generate_portlet_xml.awk >> $dest
ls -1 src/main/java/ru/urfc/portal/ui/client/googlets/admin/*.java | sed 's/.*\///g' | sed 's/\.java//g' | awk -v portlet=BasePortlet -f generate_portlet_xml.awk >> $dest
ls -1 src/main/java/ru/urfc/portal/ui/client/googlets/client/*.java | sed 's/.*\///g' | sed 's/\.java//g' | awk -v portlet=ClientPortlet -f generate_portlet_xml.awk >> $dest
ls -1 src/main/java/ru/urfc/portal/ui/client/googlets/email/*.java | sed 's/.*\///g' | sed 's/\.java//g' | awk -v portlet=EmailPortlet -f generate_portlet_xml.awk >> $dest

echo "</portlet-app>" >> $dest
